package by.gamedev.site.client.app;

import by.gamedev.site.client.app.place.ProxyListPlace;

import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.requestfactory.ui.client.LoginWidget;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasConstrainedValue;
import com.google.gwt.user.client.ui.NotificationMole;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;

/**
 * The outermost UI of the application.
 */
public class GameDevDesktopShell extends Composite {
    interface Binder extends UiBinder<Widget, GameDevDesktopShell> {
        //nothing
    }

    private static final Binder BINDER = GWT.create(Binder.class);

  //TODO    @UiField
    SimplePanel                 details;
  //TODO    @UiField
    DivElement                  error;
  //TODO    @UiField
    LoginWidget                 loginWidget;
  //TODO    @UiField
    SimplePanel                 master;
  //TODO    @UiField
    NotificationMole            mole;

    // TODO @UiField(provided = true)
    // TODO ValuePicker<ProxyListPlace> placesBox = new ValuePicker<ProxyListPlace>(new ApplicationListPlaceRenderer());

    public GameDevDesktopShell() {
        initWidget(BINDER.createAndBindUi(this));
    }

    /**
     * @return the panel to hold the details
     */
    public SimplePanel getDetailsPanel() {
        return details;
    }

    /**
     * @return the login widget
     */
    public LoginWidget getLoginWidget() {
        return loginWidget;
    }

    /**
     * @return the panel to hold the master list
     */
    public SimplePanel getMasterPanel() {
        return master;
    }

    /**
     * @return the notification mole for loading feedback
     */
    public NotificationMole getMole() {
        return mole;
    }

    /**
     * @return the navigator
     */
    public HasConstrainedValue<ProxyListPlace> getPlacesBox() {
        return null;// TODO placesBox;
    }

    /**
     * @param string
     */
    public void setError(final String string) {
        error.setInnerText(string);
    }
}
